---
id: 655a167ea3e96512bf1343ce
title: 20° passo
challengeType: 20
dashedName: step-20
---

# --description--

Inside the `search` method, delete `pass` and call the private helper method `_search` with the following arguments. You will define `_search` in the next steps.

- `self.root`: This is the root of the binary search tree. The search starts from the root.
- `key`: This is the value that the user wants to find in the binary search tree.

Internally, `search` delegates the actual search logic to the private `_search` method that performs the actual recursive search within the binary search tree.

# --hints--

You should call the `_search` method within the `search` method.

```js
({ test: () => assert.match(code, /self\._search\([^(]*\)/) });
```

You should call the `_search` method passing `self.root` and `key` as the arguments.

```js
({ test: () => assert.match(code, /self\._search\(\s*self\.root\s*,\s*key\s*\)/) });
```

# --seed--

## --seed-contents--

```py
class TreeNode:
    def __init__(self, key):
        self.key = key
        self.left = None
        self.right = None

class BinarySearchTree:
    def __init__(self):
        self.root = None

    def insert(self,key):
        self.root = self._insert(self.root, key)

    def _insert(self, node, key):
        if node is None:
            return TreeNode(key)
        if key < node.key:
            node.left = self._insert(node.left, key)
        elif key > node.key:
            node.right = self._insert(node.right, key)
        return node

--fcc-editable-region--
    def search(self, key):
        pass
--fcc-editable-region--
```
